<?php
namespace Home\Controller;
use Think\Controller;

class CommonController extends Controller{
    
    public function _initialize()
    {
        // 用户登陆状态检测
        $this->loginCheck();
    }
    
    
    public function loginCheck(){
       
        if($_SESSION['user']['userid']){
            
            return true;
        }else{
            
            $this->redirect('User/login','','3','您还未登陆，请先登陆');
        }
    }
}

